/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Clases.EntityDB;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Jose
 */
@Embeddable
public class MateriasPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "idMateria")
    private int idMateria;
    @Basic(optional = false)
    @Column(name = "grupo")
    private int grupo;

    public MateriasPK() {
    }

    public MateriasPK(int idMateria, int grupo) {
        this.idMateria = idMateria;
        this.grupo = grupo;
    }

    public int getIdMateria() {
        return idMateria;
    }

    public void setIdMateria(int idMateria) {
        this.idMateria = idMateria;
    }

    public int getGrupo() {
        return grupo;
    }

    public void setGrupo(int grupo) {
        this.grupo = grupo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idMateria;
        hash += (int) grupo;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MateriasPK)) {
            return false;
        }
        MateriasPK other = (MateriasPK) object;
        if (this.idMateria != other.idMateria) {
            return false;
        }
        if (this.grupo != other.grupo) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Clases.EntityDB.MateriasPK[ idMateria=" + idMateria + ", grupo=" + grupo + " ]";
    }
    
}
